package com.us.usws.batch.resimp;

public class ResDescFile {
	private String dir;
	private String fileName = "list.csv";

	public ResDescFile(String dir, String fileName) {
		this.dir = dir;
		this.fileName = fileName;
	}

	public ResDescFile(String path) {
		int pos1 = path.lastIndexOf('/');
		int pos2 = path.lastIndexOf('\\');
		int pos = Math.max(pos1, pos2);
		if (pos >= 0) {
			this.dir = path.substring(0, pos);
			this.fileName = path.substring(pos + 1);
		} else {
			this.fileName = path;
		}
	}

	public String getDir() {
		return dir;
	}

	public void setDir(String dir) {
		this.dir = dir;
	}

	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public String getPath() {
		return dir + "/" + fileName;
	}
}